﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="YuCeFX.aspx.cs" Inherits="Web.Pages.YongShui.ZhiBiaoFX.YuCeFX" Theme="Default" ValidateRequest="false" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../../../../JS/jquery.js"></script>
    <script src="../../../../JS/AddEditCancel.js"></script>
    <script type="text/javascript">
        function keyEnter(index) {
            var controls = new Array();
            controls[0] = document.getElementById("txtBianHao_I");
            controls[1] = document.getElementById("txtMingCheng_I");
            controls[2] = document.getElementById("memoMiaoShu_I");
            var key = event.keyCode;
            if (key == 13) {
                index = index + 1;
                if (index == controls.length) {
                    index = 0;
                }
                controls[index].focus();
            }
        }

        //导出到EXCEL  
        function tabexport(type) {
           LoadPanel.Show();
           if (type == "4") {
                //预测分析
                ASPxCallback1.PerformCallback('tab4export');
            }
        }

       
        //异步回调接收事件
        function ASPxCallbackCommonComplete(rs) {
            var arr = rs.split('|');
            var type = arr[0];
            var state = arr[1];
            var specialIdentity = arr[2];
            var msg = arr[3].split('-');
            setBtnsEnable(true);
            LoadPanel.Hide();
            if (msg[0]=='True') {
                alert(msg[1]);
            }
            hdCollection.Set("type", type);
            if (state=='True') {
                if (type.indexOf("export") > -1)//操作为导出时
                {
                    btnActPerformExport.onClick();
                }
                else {                    
                   
                }
            }
            else {
                
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            预测分析
        </div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div style="display: none;">
                    <dx:ASPxButton ID="btnActPerform" ClientInstanceName="btnActPerform" runat="server" Text="ASPxButton" UseSubmitBehavior="false" OnClick="btnActPerform_Click"></dx:ASPxButton>
                    <dx:ASPxButton ID="btnActPerformExport" ClientInstanceName="btnActPerformExport" runat="server" Text="ASPxButton" UseSubmitBehavior="false"  OnClick="btnActPerformExport_Click"></dx:ASPxButton>
                </div>
                <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
                <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallbackCommonComplete(e.result);}"></dx:ASPxCallback>

                <dx:ASPxLoadingPanel ID="LoadPanel" ClientInstanceName="LoadPanel" runat="server" Text="正在操作..."></dx:ASPxLoadingPanel>
              
                                    <div>
                                        <table>
                                            <tr>
                                                <td>
                                                    <dx:ASPxComboBox ID="tab4cmbType" runat="server" ValueType="System.String" Width="140px" ClientSideEvents-SelectedIndexChanged="function(s,e){tab4gvList1.PerformCallback();}">
                                                        <Items>
                                                            <dx:ListEditItem Text="方案预测" Value="0" Selected="true" />
                                                            <dx:ListEditItem Text="预编制计划预测" Value="1" />
                                                            <dx:ListEditItem Text="拟定/下达计划预测" Value="2" />
                                                            <dx:ListEditItem Text="考核计划年前预测" Value="3" />
                                                        </Items>
                                                    </dx:ASPxComboBox>
                                                </td>
                                                <td>
                                                    <dx:ASPxTextBox ID="tab4txtY" ClientInstanceName="tab4txtY" runat="server" Width="40px">                                                        
                                                    </dx:ASPxTextBox>
                                                </td>
                                                <td>年</td>
                                                <td>
                                                    <table>
                                            <tr>    
                                                <td style="width:20px;"></td>                                            
                                                <td style="text-align: right">
                                                    <dx:ASPxButton ID="tab4btnRefresh" runat="server" Text="刷新"  AutoPostBack="false" ClientSideEvents-Click="function(s,e){tab4gvList1.PerformCallback();}"></dx:ASPxButton>
                                                    <dx:ASPxButton ID="tab4btnExportToExcel" runat="server" Text="导出到Excel" AutoPostBack="false" ClientSideEvents-Click="function(s,e){tabexport(4);}"></dx:ASPxButton>
                                                </td>
                                            </tr>
                                        </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <div>
                                        
                                    </div>
                                    <div style="height: 3px;"></div>
                                    <dx:ASPxGridView ID="tab4gvList1" ClientInstanceName="tab4gvList1" runat="server" AutoGenerateColumns="False" KeyFieldName="S_ZHANDIAN" Theme="Aqua1" Width="100%" OnCustomCallback="tab4gvList1_CustomCallback">
                                        <Columns>
                                            <dx:GridViewDataTextColumn FieldName="S_ZHANDIAN" Caption="部门" Width="10%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="I_PLAN" Caption="计划量" Width="11%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="I_PLANZJ" Caption="计划增减" Width="11%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="I_SYSL" Caption="实用量" Width="11%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="N_CJHJE" Caption="超计划金额" Width="11%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="I_JJHC" Caption="加价户次" Width="11%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="I_JJHS" Caption="加价户数" Width="11%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="I_ZPLANHS" Caption="增加计划户" Width="12%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="I_JPLANHS" Caption="减少计划户" Width="12%">
                                            </dx:GridViewDataTextColumn>
                                        </Columns>
                                        <Settings VerticalScrollableHeight="380" VerticalScrollBarMode="Auto" HorizontalScrollBarMode="Auto" />
                                        <SettingsBehavior  AllowSort="false"/>
                                    </dx:ASPxGridView>
                                    <div>
                                        <dx:ASPxLabel ID="tab4lblTip" runat="server" Text="实用量已扣除基建量" Font-Size="Large" ForeColor="Red"></dx:ASPxLabel>
                                    </div>
                                
            </ContentTemplate>
        </asp:UpdatePanel>

    </form>
</body>
</html>


